<?php 

class Blog extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}
	
	function index()
	{
		$data['query'] = $this->db->get('articles');
		
		$data['title'] = "My Real Title";
		
		$this->load->view('blog_view', $data);
	}
	
	function comments()
	{
		
	$data['title'] = "My Comment Title";
	$this->db->where('article_id', $this->uri->segment(3));
	$data['query'] = $this->db->get('comments');	
	$this->load->view('comment_view', $data);
	}
	
	function comment_insert()
	{
		$this->db->insert('comments', $_POST);
		redirect('blog/comments/'.$_POST['article_id']);
	}
	
}
?>